var wlgz_app = function(){
	var dhid = manager.findParamFromUrl("dhid");
	var ddid = manager.findParamFromUrl("ddid");
	var flag = manager.findParamFromUrl("flag");
	var paramGz = '',
	    paramXx ='';
	if (flag == 1){//1表示从兑换记录过来的
		paramGz = 'dhgl/getWlgzxx?dhid=' + dhid
		paramXx = 'dhgl/getDhwlxx?dhid=' + dhid;
	}else{
		paramGz = 'zyddgl/getWlgzxx?ddid='+ ddid;
		paramXx = 'zyddgl/getDdwlxx?ddid=' + ddid;
	}
	function  loadWlgz(){
		$.get(manager.getContextPath() + paramGz, function(gzdata){
			var wlgzRactive = new Ractive({
				el: ".wlgz-container",
				template: "#wlgz-template",
				oncomplete: function(){
					$.get(manager.getContextPath() + paramXx, function(data){
						wlgzRactive.set("wlxx", data);
					})
					if(gzdata){
						wlgzRactive.set("wlxxList", gzdata.kdxxList);
						wlgzRactive.set("wlxxFlag", gzdata.flag);
						wlgzRactive.set("kfdh", gzdata.tel);
				    }
				}
			})
		})
	}
	return {
		init: function(){
			loadWlgz()
		}
	}
}();
$(document).ready(wlgz_app.init)